package com.example.demo.common;


public class BusinessException extends RuntimeException {
    private static final long serialVersionUID = 1L;

    private Integer state;

    private String msg;

    /**
     * @param errorEnum 以错误的ErrorEnum做参数
     */
    public BusinessException(ErrorEnum errorEnum) {
        super(errorEnum.getErrorMsg());
        this.state = errorEnum.getErrorCode();
        this.msg = errorEnum.getErrorMsg();
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }
}
